{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f1a5712d",
   "metadata": {},
   "source": [
    "* 2022-08-30\n",
    "* python学习第二周\n",
    "* 记录人：大阳\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea3fc2c0",
   "metadata": {},
   "source": [
    " ## 本周学习内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "0e5b5c88",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This minute seems a little odd.\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11,13,15,17,19,\n",
    "         21,23,25,27,29,31,33,35,37,39,\n",
    "         41,43,45,47,49,51,53,55,57,59] \n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "    \n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fab6298e",
   "metadata": {},
   "source": [
    "## 2.模块-标准库\n",
    "* 标准库是python开发团队为满足python用户日常需求而写好的一些模块，可以直接使用：import模块名称\n",
    "> 1.sys模块\n",
    ">\n",
    "> 2.os模块\n",
    ">\n",
    "> 3.datetime模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "7af639ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "f6d6a827",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'3.9.12 (main, Apr  4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys.version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "16fa8ad4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "e218fb1f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\2022-2023-01'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "168ac76d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "acb47852",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2022, 8, 30)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e116ac47",
   "metadata": {},
   "source": [
    "# 认识下 time模块 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "0da45b76",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "e974dcbf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=30, tm_hour=14, tm_min=30, tm_sec=13, tm_wday=1, tm_yday=242, tm_isdst=0)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "4d07dfae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1661841032.793201"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time() # 时间戳"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "13bcac78",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "52.6966391999321"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()/60/60/24/365"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "b13c9f7c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1970"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2022-52"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "bb5e1199",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'apple'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Input \u001b[1;32mIn [29]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mapple\u001b[39;00m\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'apple'"
     ]
    }
   ],
   "source": [
    "import apple"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "af0bf48f",
   "metadata": {},
   "source": [
    "\n",
    "## 3 赋值\n",
    "## 4 变量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0c23509c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
